#version 430 


out vec4 outColor;

in vec3 vColor;
in vec3 vPos;

void main()
{
	vec3 dir;
	if(gl_FrontFacing)
	{
		dir = normalize(vPos);
	}
	else
	{
		dir = -normalize(vPos);
	}

    float f = (dir.z + 2.0) / 2.0;
	

	outColor = vec4(vColor * f , 1.0);
}